package simple_factory

import "fmt"

type Pizza interface {
	Prepare() string
}

func NewPizza(t int) Pizza {
	if t == 1 {
		return &CheesePizza{}
	} else if t == 2 {
		return &VeggiePizza{}
	}
	return nil
}

type CheesePizza struct{}
type VeggiePizza struct{}

func (*CheesePizza) Prepare() string {
	fmt.Println("cheesePizza")
	return "cheesePizza"
}

func (*VeggiePizza) Prepare() string {
	fmt.Println("veggiePizza")
	return "veggiePizza"
}
